#include "Entity.h"

Entity::Entity()
{
}

Entity::Entity(int id, QString type, const float coord[], const float direc[], unsigned const char color[], const float scale[], int movable)
{
    this->id=id;
    this->type=type;
    if (movable==0)
        this->movable=0;
    else
        this->movable=1;
    for (int i=0; i<3; i++){
        p[i]=coord[i];
        v[i]=direc[i];
        c[i]=color[i];
        this->scale[i]=scale[i];
    }

}

int Entity::getId() const
{
    return id;
}

QString Entity::getType() const
{
    return type;
}

void Entity::setType(QString s)
{
    type=s;
}

const float* Entity::getPos() const
{
    return p;
}

void Entity::setPos(float coord[])
{
    for (int i=0; i<3; i++){
        p[i]=coord[i];
    }
}

const float* Entity::getDir() const
{
    return v;
}

void Entity::setDir(float direct[])
{
    for (int i=0; i<3; i++){
        v[i]=direct[i];
    }
}

const unsigned char* Entity::getCol() const
{
    return c;
}

void Entity::setCol(unsigned char color[])
{
    for (int i=0; i<3; i++){
        c[i]=color[i];
    }
}

const float* Entity::getScale() const
{
    return scale;
}

void Entity::setScale(float scale[])
{
    for (int i=0; i<3; i++){
        this->scale[i]=scale[i];
    }
}

void Entity::setMovable(int i){
    if (i==0)
        movable=0;
    else
        movable=1;
}

int Entity::getMovable() const{
    return movable;
}
